{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "users = [\"User1\", \"User2\", \"User3\", \"User4\", \"User5\"]\n",
    "items = [\"Item A\", \"Item B\", \"Item C\", \"Item D\", \"Item E\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "# datasets = [\n",
    "#     [\"buy\",None,\"buy\",\"buy\",None],\n",
    "#     [\"buy\",None,None,\"buy\",\"buy\"],\n",
    "#     [\"buy\",None,\"buy\",None,None],\n",
    "#     [None,\"buy\",None,\"buy\",\"buy\"],\n",
    "#     [\"buy\",\"buy\",\"buy\",None,\"buy\"],\n",
    "# ]\n",
    "\n",
    "datasets = [\n",
    "    [1,0,1,1,0],\n",
    "    [1,0,0,1,1],\n",
    "    [1,0,1,0,0],\n",
    "    [0,1,0,1,1],\n",
    "    [1,1,1,0,1],\n",
    "]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "       Item A  Item B  Item C  Item D  Item E\n",
      "User1       1       0       1       1       0\n",
      "User2       1       0       0       1       1\n",
      "User3       1       0       1       0       0\n",
      "User4       0       1       0       1       1\n",
      "User5       1       1       1       0       1\n"
     ]
    }
   ],
   "source": [
    "df=pd.DataFrame(datasets,columns=items,index=users)\n",
    "print(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.2\n"
     ]
    }
   ],
   "source": [
    "from sklearn.metrics import jaccard_similarity_score\n",
    "print(jaccard_similarity_score(df['Item A'],df['Item B']))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "data_path = \"ratings.csv\"\n",
    "\n",
    "dtype = {\"userId\": np.int32, \"movieId\": np.int32, \"rating\": np.float32}\n",
    "# 加载数据，我们只用前三列数据，分别是用户ID，电影ID，已经用户对电影的对应评分\n",
    "ratings = pd.read_csv(data_path, dtype=dtype, usecols=range(3))\n",
    "# 透视表，将电影ID转换为列名称，转换成为一个User-Movie的评分矩阵\n",
    "ratings_matrix = ratings.pivot_table(index=[\"userId\"], columns=[\"movieId\"],values=\"rating\")\n",
    "#计算用户之间相似度\n",
    "user_similar = ratings_matrix.T.corr()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th>movieId</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "      <th>4</th>\n",
       "      <th>5</th>\n",
       "      <th>6</th>\n",
       "      <th>7</th>\n",
       "      <th>8</th>\n",
       "      <th>9</th>\n",
       "      <th>10</th>\n",
       "      <th>...</th>\n",
       "      <th>193565</th>\n",
       "      <th>193567</th>\n",
       "      <th>193571</th>\n",
       "      <th>193573</th>\n",
       "      <th>193579</th>\n",
       "      <th>193581</th>\n",
       "      <th>193583</th>\n",
       "      <th>193585</th>\n",
       "      <th>193587</th>\n",
       "      <th>193609</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>userId</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>NaN</td>\n",
       "      <td>4.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>4.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>NaN</td>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>2.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>4.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>3.5</td>\n",
       "      <td>3.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>4.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>NaN</td>\n",
       "      <td>3.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>3.5</td>\n",
       "      <td>3.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>3.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>581</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>582</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>583</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>584</th>\n",
       "      <td>5.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>585</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>586</th>\n",
       "      <td>NaN</td>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>587</th>\n",
       "      <td>5.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>588</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>589</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>590</th>\n",
       "      <td>4.0</td>\n",
       "      <td>2.5</td>\n",
       "      <td>3.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.0</td>\n",
       "      <td>3.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.5</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>591</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>592</th>\n",
       "      <td>NaN</td>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>593</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>594</th>\n",
       "      <td>NaN</td>\n",
       "      <td>4.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>595</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>596</th>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>597</th>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>598</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>599</th>\n",
       "      <td>3.0</td>\n",
       "      <td>2.5</td>\n",
       "      <td>1.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4.5</td>\n",
       "      <td>2.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.5</td>\n",
       "      <td>3.5</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>600</th>\n",
       "      <td>2.5</td>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.5</td>\n",
       "      <td>2.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>601</th>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>602</th>\n",
       "      <td>NaN</td>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>603</th>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>604</th>\n",
       "      <td>3.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>605</th>\n",
       "      <td>4.0</td>\n",
       "      <td>3.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>606</th>\n",
       "      <td>2.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>607</th>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>608</th>\n",
       "      <td>2.5</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>609</th>\n",
       "      <td>3.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>610</th>\n",
       "      <td>5.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>610 rows × 9724 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "movieId  1       2       3       4       5       6       7       8       \\\n",
       "userId                                                                    \n",
       "1           4.0     NaN     4.0     NaN     NaN     4.0     NaN     NaN   \n",
       "2           NaN     NaN     NaN     NaN     NaN     NaN     NaN     NaN   \n",
       "3           NaN     NaN     NaN     NaN     NaN     NaN     NaN     NaN   \n",
       "4           NaN     NaN     NaN     NaN     NaN     NaN     NaN     NaN   \n",
       "5           4.0     NaN     NaN     NaN     NaN     NaN     NaN     NaN   \n",
       "6           NaN     4.0     5.0     3.0     5.0     4.0     4.0     3.0   \n",
       "7           4.5     NaN     NaN     NaN     NaN     NaN     NaN     NaN   \n",
       "8           NaN     4.0     NaN     NaN     NaN     NaN     NaN     NaN   \n",
       "9           NaN     NaN     NaN     NaN     NaN     NaN     NaN     NaN   \n",
       "10          NaN     NaN     NaN     NaN     NaN     NaN     NaN     NaN   \n",
       "11          NaN     NaN     NaN     NaN     NaN     5.0     NaN     NaN   \n",
       "12          NaN     NaN     NaN     NaN     NaN     NaN     NaN     NaN   \n",
       "13          NaN     NaN     NaN     NaN     NaN     NaN     NaN     NaN   \n",
       "14          NaN     NaN     NaN     3.0     NaN     NaN     3.0     NaN   \n",
       "15          2.5     NaN     NaN     NaN     NaN     NaN     NaN     NaN   \n",
       "16          NaN     NaN     NaN     NaN     NaN     NaN     NaN     NaN   \n",
       "17          4.5     NaN     NaN     NaN     NaN     NaN     NaN     NaN   \n",
       "18          3.5     3.0     NaN     NaN     NaN     4.0     NaN     NaN   \n",
       "19          4.0     3.0     3.0     NaN     NaN     NaN     2.0     NaN   \n",
       "20          NaN     3.0     NaN     NaN     NaN     NaN     NaN     1.0   \n",
       "21          3.5     3.5     NaN     NaN     NaN     NaN     NaN     NaN   \n",
       "22          NaN     NaN     NaN     NaN     NaN     NaN     NaN     NaN   \n",
       "23          NaN     NaN     NaN     NaN     NaN     4.0     NaN     NaN   \n",
       "24          NaN     NaN     NaN     NaN     NaN     4.5     NaN     NaN   \n",
       "25          NaN     NaN     NaN     NaN     NaN     NaN     NaN     NaN   \n",
       "26          NaN     NaN     NaN     NaN     NaN     NaN     NaN     NaN   \n",
       "27          3.0     4.0     NaN     NaN     NaN     NaN     NaN     NaN   \n",
       "28          NaN     NaN     NaN     NaN     NaN     3.5     NaN     NaN   \n",
       "29          NaN     NaN     NaN     NaN     NaN     NaN     NaN     NaN   \n",
       "30          NaN     NaN     NaN     NaN     NaN     NaN     NaN     NaN   \n",
       "...         ...     ...     ...     ...     ...     ...     ...     ...   \n",
       "581         NaN     NaN     NaN     NaN     NaN     NaN     NaN     NaN   \n",
       "582         NaN     NaN     NaN     NaN     NaN     NaN     NaN     NaN   \n",
       "583         NaN     NaN     NaN     NaN     NaN     NaN     NaN     NaN   \n",
       "584         5.0     NaN     NaN     NaN     NaN     NaN     NaN     NaN   \n",
       "585         NaN     NaN     NaN     NaN     NaN     NaN     NaN     NaN   \n",
       "586         NaN     4.0     NaN     NaN     NaN     NaN     NaN     NaN   \n",
       "587         5.0     NaN     NaN     NaN     NaN     NaN     NaN     NaN   \n",
       "588         NaN     NaN     3.0     NaN     NaN     5.0     NaN     NaN   \n",
       "589         NaN     NaN     NaN     NaN     NaN     NaN     NaN     NaN   \n",
       "590         4.0     2.5     3.0     NaN     2.0     3.5     NaN     NaN   \n",
       "591         NaN     NaN     NaN     NaN     NaN     NaN     NaN     NaN   \n",
       "592         NaN     4.0     NaN     NaN     NaN     3.0     NaN     NaN   \n",
       "593         NaN     NaN     NaN     NaN     NaN     NaN     NaN     NaN   \n",
       "594         NaN     4.0     4.0     NaN     NaN     NaN     NaN     NaN   \n",
       "595         NaN     NaN     NaN     NaN     NaN     NaN     NaN     NaN   \n",
       "596         4.0     NaN     NaN     NaN     NaN     NaN     NaN     NaN   \n",
       "597         4.0     NaN     NaN     NaN     NaN     3.0     1.0     NaN   \n",
       "598         NaN     NaN     NaN     NaN     NaN     NaN     NaN     NaN   \n",
       "599         3.0     2.5     1.5     NaN     NaN     4.5     2.5     NaN   \n",
       "600         2.5     4.0     NaN     1.5     2.5     NaN     3.5     NaN   \n",
       "601         4.0     NaN     NaN     NaN     NaN     NaN     NaN     NaN   \n",
       "602         NaN     4.0     NaN     NaN     NaN     3.0     NaN     NaN   \n",
       "603         4.0     NaN     NaN     NaN     NaN     4.0     NaN     NaN   \n",
       "604         3.0     5.0     NaN     NaN     3.0     3.0     NaN     NaN   \n",
       "605         4.0     3.5     NaN     NaN     NaN     NaN     NaN     NaN   \n",
       "606         2.5     NaN     NaN     NaN     NaN     NaN     2.5     NaN   \n",
       "607         4.0     NaN     NaN     NaN     NaN     NaN     NaN     NaN   \n",
       "608         2.5     2.0     2.0     NaN     NaN     NaN     NaN     NaN   \n",
       "609         3.0     NaN     NaN     NaN     NaN     NaN     NaN     NaN   \n",
       "610         5.0     NaN     NaN     NaN     NaN     5.0     NaN     NaN   \n",
       "\n",
       "movieId  9       10       ...    193565  193567  193571  193573  193579  \\\n",
       "userId                    ...                                             \n",
       "1           NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "2           NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "3           NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "4           NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "5           NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "6           NaN     3.0   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "7           NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "8           NaN     2.0   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "9           NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "10          NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "11          NaN     3.0   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "12          NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "13          NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "14          NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "15          NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "16          NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "17          NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "18          NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "19          NaN     2.0   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "20          NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "21          NaN     5.0   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "22          NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "23          NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "24          NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "25          NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "26          NaN     3.0   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "27          NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "28          NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "29          NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "30          NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "...         ...     ...   ...       ...     ...     ...     ...     ...   \n",
       "581         NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "582         NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "583         NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "584         NaN     5.0   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "585         NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "586         NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "587         NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "588         NaN     3.0   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "589         NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "590         NaN     3.5   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "591         NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "592         NaN     3.0   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "593         NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "594         NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "595         NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "596         NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "597         NaN     3.0   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "598         NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "599         1.5     3.5   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "600         NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "601         NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "602         NaN     3.0   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "603         NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "604         NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "605         NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "606         NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "607         NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "608         NaN     4.0   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "609         NaN     4.0   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "610         NaN     NaN   ...       NaN     NaN     NaN     NaN     NaN   \n",
       "\n",
       "movieId  193581  193583  193585  193587  193609  \n",
       "userId                                           \n",
       "1           NaN     NaN     NaN     NaN     NaN  \n",
       "2           NaN     NaN     NaN     NaN     NaN  \n",
       "3           NaN     NaN     NaN     NaN     NaN  \n",
       "4           NaN     NaN     NaN     NaN     NaN  \n",
       "5           NaN     NaN     NaN     NaN     NaN  \n",
       "6           NaN     NaN     NaN     NaN     NaN  \n",
       "7           NaN     NaN     NaN     NaN     NaN  \n",
       "8           NaN     NaN     NaN     NaN     NaN  \n",
       "9           NaN     NaN     NaN     NaN     NaN  \n",
       "10          NaN     NaN     NaN     NaN     NaN  \n",
       "11          NaN     NaN     NaN     NaN     NaN  \n",
       "12          NaN     NaN     NaN     NaN     NaN  \n",
       "13          NaN     NaN     NaN     NaN     NaN  \n",
       "14          NaN     NaN     NaN     NaN     NaN  \n",
       "15          NaN     NaN     NaN     NaN     NaN  \n",
       "16          NaN     NaN     NaN     NaN     NaN  \n",
       "17          NaN     NaN     NaN     NaN     NaN  \n",
       "18          NaN     NaN     NaN     NaN     NaN  \n",
       "19          NaN     NaN     NaN     NaN     NaN  \n",
       "20          NaN     NaN     NaN     NaN     NaN  \n",
       "21          NaN     NaN     NaN     NaN     NaN  \n",
       "22          NaN     NaN     NaN     NaN     NaN  \n",
       "23          NaN     NaN     NaN     NaN     NaN  \n",
       "24          NaN     NaN     NaN     NaN     NaN  \n",
       "25          NaN     NaN     NaN     NaN     NaN  \n",
       "26          NaN     NaN     NaN     NaN     NaN  \n",
       "27          NaN     NaN     NaN     NaN     NaN  \n",
       "28          NaN     NaN     NaN     NaN     NaN  \n",
       "29          NaN     NaN     NaN     NaN     NaN  \n",
       "30          NaN     NaN     NaN     NaN     NaN  \n",
       "...         ...     ...     ...     ...     ...  \n",
       "581         NaN     NaN     NaN     NaN     NaN  \n",
       "582         NaN     NaN     NaN     NaN     NaN  \n",
       "583         NaN     NaN     NaN     NaN     NaN  \n",
       "584         NaN     NaN     NaN     NaN     NaN  \n",
       "585         NaN     NaN     NaN     NaN     NaN  \n",
       "586         NaN     NaN     NaN     NaN     NaN  \n",
       "587         NaN     NaN     NaN     NaN     NaN  \n",
       "588         NaN     NaN     NaN     NaN     NaN  \n",
       "589         NaN     NaN     NaN     NaN     NaN  \n",
       "590         NaN     NaN     NaN     NaN     NaN  \n",
       "591         NaN     NaN     NaN     NaN     NaN  \n",
       "592         NaN     NaN     NaN     NaN     NaN  \n",
       "593         NaN     NaN     NaN     NaN     NaN  \n",
       "594         NaN     NaN     NaN     NaN     NaN  \n",
       "595         NaN     NaN     NaN     NaN     NaN  \n",
       "596         NaN     NaN     NaN     NaN     NaN  \n",
       "597         NaN     NaN     NaN     NaN     NaN  \n",
       "598         NaN     NaN     NaN     NaN     NaN  \n",
       "599         NaN     NaN     NaN     NaN     NaN  \n",
       "600         NaN     NaN     NaN     NaN     NaN  \n",
       "601         NaN     NaN     NaN     NaN     NaN  \n",
       "602         NaN     NaN     NaN     NaN     NaN  \n",
       "603         NaN     NaN     NaN     NaN     NaN  \n",
       "604         NaN     NaN     NaN     NaN     NaN  \n",
       "605         NaN     NaN     NaN     NaN     NaN  \n",
       "606         NaN     NaN     NaN     NaN     NaN  \n",
       "607         NaN     NaN     NaN     NaN     NaN  \n",
       "608         NaN     NaN     NaN     NaN     NaN  \n",
       "609         NaN     NaN     NaN     NaN     NaN  \n",
       "610         NaN     NaN     NaN     NaN     NaN  \n",
       "\n",
       "[610 rows x 9724 columns]"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ratings_matrix"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th>userId</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "      <th>4</th>\n",
       "      <th>5</th>\n",
       "      <th>6</th>\n",
       "      <th>7</th>\n",
       "      <th>8</th>\n",
       "      <th>9</th>\n",
       "      <th>10</th>\n",
       "      <th>...</th>\n",
       "      <th>601</th>\n",
       "      <th>602</th>\n",
       "      <th>603</th>\n",
       "      <th>604</th>\n",
       "      <th>605</th>\n",
       "      <th>606</th>\n",
       "      <th>607</th>\n",
       "      <th>608</th>\n",
       "      <th>609</th>\n",
       "      <th>610</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>userId</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.079819</td>\n",
       "      <td>0.207983</td>\n",
       "      <td>0.268749</td>\n",
       "      <td>-2.916358e-01</td>\n",
       "      <td>-0.118773</td>\n",
       "      <td>0.469668</td>\n",
       "      <td>0.918559</td>\n",
       "      <td>-0.037987</td>\n",
       "      <td>...</td>\n",
       "      <td>0.091574</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>-0.061503</td>\n",
       "      <td>-0.407556</td>\n",
       "      <td>-0.164871</td>\n",
       "      <td>6.637849e-02</td>\n",
       "      <td>0.174557</td>\n",
       "      <td>0.268070</td>\n",
       "      <td>-0.175412</td>\n",
       "      <td>-0.032086</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>NaN</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.991241</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.037796</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.387347</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5.833333e-01</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.125000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.623288</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.079819</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.433200</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-7.913343e-01</td>\n",
       "      <td>-0.333333</td>\n",
       "      <td>-0.395092</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.569562</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.207983</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.336525</td>\n",
       "      <td>1.484982e-01</td>\n",
       "      <td>0.542861</td>\n",
       "      <td>0.117851</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.485794</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.222113</td>\n",
       "      <td>0.396641</td>\n",
       "      <td>0.090090</td>\n",
       "      <td>-0.080296</td>\n",
       "      <td>0.400124</td>\n",
       "      <td>1.446033e-01</td>\n",
       "      <td>0.116518</td>\n",
       "      <td>-0.170501</td>\n",
       "      <td>-0.277350</td>\n",
       "      <td>-0.043786</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>0.268749</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.336525</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>4.316590e-02</td>\n",
       "      <td>0.158114</td>\n",
       "      <td>0.028347</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.777714</td>\n",
       "      <td>...</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.153303</td>\n",
       "      <td>0.234743</td>\n",
       "      <td>0.067791</td>\n",
       "      <td>-0.364156</td>\n",
       "      <td>2.443212e-01</td>\n",
       "      <td>0.231080</td>\n",
       "      <td>-0.020546</td>\n",
       "      <td>0.384111</td>\n",
       "      <td>0.040582</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>-0.291636</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.148498</td>\n",
       "      <td>0.043166</td>\n",
       "      <td>1.000000e+00</td>\n",
       "      <td>-0.126595</td>\n",
       "      <td>-0.200062</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.957427</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.292770</td>\n",
       "      <td>-0.027495</td>\n",
       "      <td>-0.112141</td>\n",
       "      <td>-0.090297</td>\n",
       "      <td>0.100735</td>\n",
       "      <td>-4.919190e-02</td>\n",
       "      <td>0.255639</td>\n",
       "      <td>0.125428</td>\n",
       "      <td>0.193649</td>\n",
       "      <td>0.115580</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>-0.118773</td>\n",
       "      <td>-0.991241</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.542861</td>\n",
       "      <td>0.158114</td>\n",
       "      <td>-1.265950e-01</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.220416</td>\n",
       "      <td>0.925000</td>\n",
       "      <td>-0.156764</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.280496</td>\n",
       "      <td>0.110432</td>\n",
       "      <td>0.343649</td>\n",
       "      <td>0.560968</td>\n",
       "      <td>0.416186</td>\n",
       "      <td>1.377715e-01</td>\n",
       "      <td>0.402792</td>\n",
       "      <td>0.008081</td>\n",
       "      <td>0.420288</td>\n",
       "      <td>0.341233</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>0.469668</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.117851</td>\n",
       "      <td>0.028347</td>\n",
       "      <td>-2.000621e-01</td>\n",
       "      <td>0.220416</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.190902</td>\n",
       "      <td>0.249252</td>\n",
       "      <td>0.534375</td>\n",
       "      <td>-0.217405</td>\n",
       "      <td>2.535821e-01</td>\n",
       "      <td>0.251280</td>\n",
       "      <td>0.434423</td>\n",
       "      <td>0.141860</td>\n",
       "      <td>0.167931</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>0.918559</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.925000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>0.577350</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.376715</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.158777</td>\n",
       "      <td>5.726999e-01</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.336625</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.615638</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>-0.037987</td>\n",
       "      <td>0.037796</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.485794</td>\n",
       "      <td>-0.777714</td>\n",
       "      <td>9.574271e-01</td>\n",
       "      <td>-0.156764</td>\n",
       "      <td>-1.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.397276</td>\n",
       "      <td>-0.944911</td>\n",
       "      <td>-0.424631</td>\n",
       "      <td>-1.000000</td>\n",
       "      <td>0.268684</td>\n",
       "      <td>-3.829551e-01</td>\n",
       "      <td>-0.241121</td>\n",
       "      <td>-0.571043</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.205081</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>-0.087643</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.564737</td>\n",
       "      <td>0.268293</td>\n",
       "      <td>4.832447e-01</td>\n",
       "      <td>-0.027349</td>\n",
       "      <td>0.253576</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.301511</td>\n",
       "      <td>0.274963</td>\n",
       "      <td>-0.176996</td>\n",
       "      <td>-0.015131</td>\n",
       "      <td>-0.019104</td>\n",
       "      <td>6.213867e-01</td>\n",
       "      <td>0.434014</td>\n",
       "      <td>0.335976</td>\n",
       "      <td>0.151744</td>\n",
       "      <td>0.137054</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.344031</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>-1.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.562500</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.248679</td>\n",
       "      <td>-0.507093</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>8.956222e-02</td>\n",
       "      <td>-0.365148</td>\n",
       "      <td>-0.322817</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.672977</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>0.878310</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.558242</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.500000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.381246</td>\n",
       "      <td>...</td>\n",
       "      <td>0.375000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.674020</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>7.755102e-02</td>\n",
       "      <td>0.188982</td>\n",
       "      <td>0.493318</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.796969</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>0.229081</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.139347</td>\n",
       "      <td>-0.153323</td>\n",
       "      <td>2.766621e-01</td>\n",
       "      <td>0.806872</td>\n",
       "      <td>0.123460</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>...</td>\n",
       "      <td>-1.000000</td>\n",
       "      <td>0.017314</td>\n",
       "      <td>0.188061</td>\n",
       "      <td>0.507168</td>\n",
       "      <td>-0.151620</td>\n",
       "      <td>3.468145e-01</td>\n",
       "      <td>0.223669</td>\n",
       "      <td>0.238901</td>\n",
       "      <td>-0.077615</td>\n",
       "      <td>0.140482</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>0.232636</td>\n",
       "      <td>-0.330174</td>\n",
       "      <td>-0.944911</td>\n",
       "      <td>0.481605</td>\n",
       "      <td>-0.252352</td>\n",
       "      <td>1.163945e-02</td>\n",
       "      <td>-0.155384</td>\n",
       "      <td>-0.139122</td>\n",
       "      <td>-0.482805</td>\n",
       "      <td>-0.030515</td>\n",
       "      <td>...</td>\n",
       "      <td>0.098446</td>\n",
       "      <td>0.665169</td>\n",
       "      <td>-0.047094</td>\n",
       "      <td>0.534634</td>\n",
       "      <td>0.124442</td>\n",
       "      <td>8.667785e-02</td>\n",
       "      <td>-0.084814</td>\n",
       "      <td>0.344304</td>\n",
       "      <td>0.458333</td>\n",
       "      <td>-0.099907</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>0.191851</td>\n",
       "      <td>-0.176471</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.137553</td>\n",
       "      <td>-0.684653</td>\n",
       "      <td>-1.837726e-02</td>\n",
       "      <td>-0.096233</td>\n",
       "      <td>0.665133</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.583639</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.157174</td>\n",
       "      <td>0.086212</td>\n",
       "      <td>0.157807</td>\n",
       "      <td>-0.754337</td>\n",
       "      <td>0.012649</td>\n",
       "      <td>-4.867394e-02</td>\n",
       "      <td>0.055125</td>\n",
       "      <td>-0.302915</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.134150</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>0.037901</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.218928</td>\n",
       "      <td>0.310835</td>\n",
       "      <td>2.400077e-02</td>\n",
       "      <td>0.287803</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.005896</td>\n",
       "      <td>...</td>\n",
       "      <td>0.192548</td>\n",
       "      <td>0.323875</td>\n",
       "      <td>0.174955</td>\n",
       "      <td>0.528594</td>\n",
       "      <td>-0.147821</td>\n",
       "      <td>1.226658e-01</td>\n",
       "      <td>-0.189118</td>\n",
       "      <td>0.300821</td>\n",
       "      <td>0.638915</td>\n",
       "      <td>-0.034653</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>0.205371</td>\n",
       "      <td>-0.264646</td>\n",
       "      <td>-0.354548</td>\n",
       "      <td>-0.007641</td>\n",
       "      <td>0.162995</td>\n",
       "      <td>9.380339e-03</td>\n",
       "      <td>0.206082</td>\n",
       "      <td>0.029953</td>\n",
       "      <td>0.252714</td>\n",
       "      <td>-0.082679</td>\n",
       "      <td>...</td>\n",
       "      <td>0.264801</td>\n",
       "      <td>0.423578</td>\n",
       "      <td>0.389637</td>\n",
       "      <td>0.203806</td>\n",
       "      <td>0.103834</td>\n",
       "      <td>5.216392e-01</td>\n",
       "      <td>0.169145</td>\n",
       "      <td>0.375750</td>\n",
       "      <td>0.400000</td>\n",
       "      <td>0.327397</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>0.325180</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.442498</td>\n",
       "      <td>0.072000</td>\n",
       "      <td>0.271827</td>\n",
       "      <td>2.591888e-01</td>\n",
       "      <td>0.194649</td>\n",
       "      <td>0.139882</td>\n",
       "      <td>0.976296</td>\n",
       "      <td>-0.561617</td>\n",
       "      <td>...</td>\n",
       "      <td>0.561962</td>\n",
       "      <td>0.246154</td>\n",
       "      <td>0.160288</td>\n",
       "      <td>0.093863</td>\n",
       "      <td>0.256556</td>\n",
       "      <td>2.542703e-01</td>\n",
       "      <td>0.003567</td>\n",
       "      <td>0.229268</td>\n",
       "      <td>-0.068519</td>\n",
       "      <td>0.399213</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>0.419641</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.620758</td>\n",
       "      <td>0.040032</td>\n",
       "      <td>2.133011e-01</td>\n",
       "      <td>0.451035</td>\n",
       "      <td>0.747018</td>\n",
       "      <td>0.561249</td>\n",
       "      <td>0.122967</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.338062</td>\n",
       "      <td>0.393445</td>\n",
       "      <td>0.244265</td>\n",
       "      <td>-0.610802</td>\n",
       "      <td>0.085819</td>\n",
       "      <td>4.328764e-01</td>\n",
       "      <td>0.319964</td>\n",
       "      <td>0.030331</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.413368</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>0.107119</td>\n",
       "      <td>-0.020535</td>\n",
       "      <td>-0.991241</td>\n",
       "      <td>-0.059131</td>\n",
       "      <td>-0.339422</td>\n",
       "      <td>3.057183e-01</td>\n",
       "      <td>0.024363</td>\n",
       "      <td>0.084020</td>\n",
       "      <td>-0.386592</td>\n",
       "      <td>0.269043</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.150859</td>\n",
       "      <td>0.147429</td>\n",
       "      <td>-0.485182</td>\n",
       "      <td>0.265872</td>\n",
       "      <td>-0.008274</td>\n",
       "      <td>-1.638329e-01</td>\n",
       "      <td>-0.237823</td>\n",
       "      <td>0.028065</td>\n",
       "      <td>0.623250</td>\n",
       "      <td>-0.063044</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>-0.463039</td>\n",
       "      <td>-0.619292</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.259412</td>\n",
       "      <td>NaN</td>\n",
       "      <td>8.964215e-01</td>\n",
       "      <td>0.053010</td>\n",
       "      <td>-0.500000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.035275</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.113398</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>0.424252</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.321719</td>\n",
       "      <td>2.230021e-02</td>\n",
       "      <td>0.141421</td>\n",
       "      <td>-0.106111</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.208517</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>-0.364372</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.229480</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>-4.050463e-01</td>\n",
       "      <td>0.175781</td>\n",
       "      <td>0.324443</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.218218</td>\n",
       "      <td>...</td>\n",
       "      <td>0.261839</td>\n",
       "      <td>-0.090909</td>\n",
       "      <td>0.023665</td>\n",
       "      <td>-0.190941</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>2.367592e-01</td>\n",
       "      <td>0.024012</td>\n",
       "      <td>-0.029124</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.074424</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>0.249046</td>\n",
       "      <td>-0.641689</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.151800</td>\n",
       "      <td>0.193649</td>\n",
       "      <td>7.775791e-02</td>\n",
       "      <td>-0.057351</td>\n",
       "      <td>0.166667</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.049613</td>\n",
       "      <td>...</td>\n",
       "      <td>0.448297</td>\n",
       "      <td>0.128046</td>\n",
       "      <td>0.207174</td>\n",
       "      <td>-0.099340</td>\n",
       "      <td>-0.229170</td>\n",
       "      <td>1.857959e-01</td>\n",
       "      <td>0.195180</td>\n",
       "      <td>0.176818</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.121548</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>-0.166667</td>\n",
       "      <td>0.108465</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>0.284901</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>7.287987e-01</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.693375</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.371303</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>0.141421</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.586739</td>\n",
       "      <td>-1.036641e-17</td>\n",
       "      <td>-0.099504</td>\n",
       "      <td>0.094655</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.566266</td>\n",
       "      <td>0.408248</td>\n",
       "      <td>0.448943</td>\n",
       "      <td>-0.625000</td>\n",
       "      <td>9.128709e-02</td>\n",
       "      <td>0.224934</td>\n",
       "      <td>0.493881</td>\n",
       "      <td>0.336011</td>\n",
       "      <td>0.701646</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>0.189437</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.101143</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>4.821188e-01</td>\n",
       "      <td>-0.117892</td>\n",
       "      <td>-0.108465</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.654654</td>\n",
       "      <td>...</td>\n",
       "      <td>0.198030</td>\n",
       "      <td>-0.255678</td>\n",
       "      <td>-0.318164</td>\n",
       "      <td>0.114708</td>\n",
       "      <td>0.194420</td>\n",
       "      <td>-4.161383e-02</td>\n",
       "      <td>0.058042</td>\n",
       "      <td>0.018718</td>\n",
       "      <td>0.707107</td>\n",
       "      <td>-0.199442</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>-0.014257</td>\n",
       "      <td>-0.166667</td>\n",
       "      <td>0.204140</td>\n",
       "      <td>0.125013</td>\n",
       "      <td>0.201241</td>\n",
       "      <td>-1.383784e-01</td>\n",
       "      <td>0.000068</td>\n",
       "      <td>0.056400</td>\n",
       "      <td>-0.057640</td>\n",
       "      <td>-0.051243</td>\n",
       "      <td>...</td>\n",
       "      <td>0.122248</td>\n",
       "      <td>0.104556</td>\n",
       "      <td>0.040900</td>\n",
       "      <td>0.031379</td>\n",
       "      <td>0.064034</td>\n",
       "      <td>7.209501e-02</td>\n",
       "      <td>-0.123055</td>\n",
       "      <td>0.202252</td>\n",
       "      <td>0.337080</td>\n",
       "      <td>0.176014</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>-0.070495</td>\n",
       "      <td>-0.310087</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.455842</td>\n",
       "      <td>-0.681385</td>\n",
       "      <td>7.145774e-01</td>\n",
       "      <td>-0.428521</td>\n",
       "      <td>-0.298807</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.568982</td>\n",
       "      <td>...</td>\n",
       "      <td>0.132353</td>\n",
       "      <td>0.030802</td>\n",
       "      <td>0.560054</td>\n",
       "      <td>0.426401</td>\n",
       "      <td>0.368782</td>\n",
       "      <td>-5.475182e-17</td>\n",
       "      <td>0.372222</td>\n",
       "      <td>0.032340</td>\n",
       "      <td>0.174078</td>\n",
       "      <td>0.048994</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>-0.142857</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>1.000000e+00</td>\n",
       "      <td>0.105577</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.303770</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.403473</td>\n",
       "      <td>4.536438e-01</td>\n",
       "      <td>-0.312255</td>\n",
       "      <td>0.402953</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>-0.251636</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>581</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>-0.790569</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.688499</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-5.000000e-01</td>\n",
       "      <td>0.069077</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.324953</td>\n",
       "      <td>...</td>\n",
       "      <td>0.223836</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.311400</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.297936</td>\n",
       "      <td>-4.707512e-03</td>\n",
       "      <td>0.069843</td>\n",
       "      <td>-0.247073</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.107907</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>582</th>\n",
       "      <td>0.250000</td>\n",
       "      <td>0.044194</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.613941</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.325818</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.135653</td>\n",
       "      <td>...</td>\n",
       "      <td>0.093532</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.400000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.027639</td>\n",
       "      <td>-1.935282e-02</td>\n",
       "      <td>0.577350</td>\n",
       "      <td>0.438529</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.415336</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>583</th>\n",
       "      <td>-0.037878</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.793045</td>\n",
       "      <td>-0.612372</td>\n",
       "      <td>-1.477635e-01</td>\n",
       "      <td>-0.300123</td>\n",
       "      <td>-0.663403</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.380072</td>\n",
       "      <td>...</td>\n",
       "      <td>0.583333</td>\n",
       "      <td>-0.080845</td>\n",
       "      <td>0.249950</td>\n",
       "      <td>-0.391965</td>\n",
       "      <td>0.310530</td>\n",
       "      <td>2.557321e-01</td>\n",
       "      <td>-1.000000</td>\n",
       "      <td>-0.048508</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.099776</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>584</th>\n",
       "      <td>-0.076086</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.127294</td>\n",
       "      <td>0.257629</td>\n",
       "      <td>4.749685e-01</td>\n",
       "      <td>0.132260</td>\n",
       "      <td>0.078422</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.514259</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.154225</td>\n",
       "      <td>-0.105695</td>\n",
       "      <td>0.078851</td>\n",
       "      <td>0.116250</td>\n",
       "      <td>-1.458650e-01</td>\n",
       "      <td>0.709014</td>\n",
       "      <td>-0.104141</td>\n",
       "      <td>-0.032978</td>\n",
       "      <td>0.521057</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>585</th>\n",
       "      <td>0.055703</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.058537</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5.000000e-01</td>\n",
       "      <td>-0.174078</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.894675</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.500000</td>\n",
       "      <td>0.250000</td>\n",
       "      <td>-0.103975</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-1.000000</td>\n",
       "      <td>1.836735e-01</td>\n",
       "      <td>0.577350</td>\n",
       "      <td>0.001186</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.059085</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>586</th>\n",
       "      <td>0.163573</td>\n",
       "      <td>-0.197203</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.170842</td>\n",
       "      <td>-0.423659</td>\n",
       "      <td>2.995523e-01</td>\n",
       "      <td>0.036261</td>\n",
       "      <td>-0.198539</td>\n",
       "      <td>0.142857</td>\n",
       "      <td>0.101297</td>\n",
       "      <td>...</td>\n",
       "      <td>0.112945</td>\n",
       "      <td>0.224965</td>\n",
       "      <td>-0.343401</td>\n",
       "      <td>-0.286770</td>\n",
       "      <td>0.376335</td>\n",
       "      <td>-6.999917e-02</td>\n",
       "      <td>-0.343266</td>\n",
       "      <td>0.102785</td>\n",
       "      <td>0.342594</td>\n",
       "      <td>0.038017</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>587</th>\n",
       "      <td>-0.302195</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.500000</td>\n",
       "      <td>-0.259693</td>\n",
       "      <td>0.704361</td>\n",
       "      <td>3.380148e-02</td>\n",
       "      <td>-0.253046</td>\n",
       "      <td>0.094555</td>\n",
       "      <td>-0.277350</td>\n",
       "      <td>-0.126745</td>\n",
       "      <td>...</td>\n",
       "      <td>0.194257</td>\n",
       "      <td>0.302627</td>\n",
       "      <td>-0.079892</td>\n",
       "      <td>0.724882</td>\n",
       "      <td>0.066567</td>\n",
       "      <td>1.583314e-01</td>\n",
       "      <td>-0.125983</td>\n",
       "      <td>0.212576</td>\n",
       "      <td>0.166667</td>\n",
       "      <td>0.396926</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>588</th>\n",
       "      <td>-0.028161</td>\n",
       "      <td>-1.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.357217</td>\n",
       "      <td>0.314098</td>\n",
       "      <td>7.215966e-02</td>\n",
       "      <td>0.474101</td>\n",
       "      <td>0.084579</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>0.870388</td>\n",
       "      <td>0.476251</td>\n",
       "      <td>-0.019080</td>\n",
       "      <td>0.102512</td>\n",
       "      <td>-0.498922</td>\n",
       "      <td>5.858504e-01</td>\n",
       "      <td>0.642569</td>\n",
       "      <td>0.531998</td>\n",
       "      <td>0.373737</td>\n",
       "      <td>0.198529</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>589</th>\n",
       "      <td>-0.388075</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.052342</td>\n",
       "      <td>0.484248</td>\n",
       "      <td>4.108614e-01</td>\n",
       "      <td>-0.133631</td>\n",
       "      <td>0.116775</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.317258</td>\n",
       "      <td>0.164717</td>\n",
       "      <td>0.520855</td>\n",
       "      <td>-0.868243</td>\n",
       "      <td>3.984854e-01</td>\n",
       "      <td>-0.290129</td>\n",
       "      <td>0.370555</td>\n",
       "      <td>0.885438</td>\n",
       "      <td>-0.154303</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>590</th>\n",
       "      <td>0.311182</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>-0.471728</td>\n",
       "      <td>0.388334</td>\n",
       "      <td>0.402967</td>\n",
       "      <td>1.119786e-01</td>\n",
       "      <td>0.449615</td>\n",
       "      <td>0.323569</td>\n",
       "      <td>0.486943</td>\n",
       "      <td>0.110148</td>\n",
       "      <td>...</td>\n",
       "      <td>0.331841</td>\n",
       "      <td>0.498185</td>\n",
       "      <td>0.337366</td>\n",
       "      <td>0.317766</td>\n",
       "      <td>0.300918</td>\n",
       "      <td>5.564658e-01</td>\n",
       "      <td>0.152790</td>\n",
       "      <td>0.231666</td>\n",
       "      <td>0.280692</td>\n",
       "      <td>0.522279</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>591</th>\n",
       "      <td>0.280875</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.024876</td>\n",
       "      <td>NaN</td>\n",
       "      <td>9.449112e-01</td>\n",
       "      <td>0.038029</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.399381</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.468521</td>\n",
       "      <td>0.188982</td>\n",
       "      <td>-0.044991</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.687500</td>\n",
       "      <td>-8.918451e-02</td>\n",
       "      <td>0.046176</td>\n",
       "      <td>0.133974</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.059337</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>592</th>\n",
       "      <td>-0.096225</td>\n",
       "      <td>-1.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.054554</td>\n",
       "      <td>-0.104103</td>\n",
       "      <td>3.039877e-01</td>\n",
       "      <td>0.140563</td>\n",
       "      <td>0.114093</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.257130</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.225521</td>\n",
       "      <td>-0.076214</td>\n",
       "      <td>-0.004300</td>\n",
       "      <td>0.043129</td>\n",
       "      <td>1.934440e-01</td>\n",
       "      <td>0.413537</td>\n",
       "      <td>0.154820</td>\n",
       "      <td>0.037860</td>\n",
       "      <td>0.257958</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>593</th>\n",
       "      <td>0.492483</td>\n",
       "      <td>-0.576557</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.239270</td>\n",
       "      <td>0.327896</td>\n",
       "      <td>-1.125112e-01</td>\n",
       "      <td>0.230481</td>\n",
       "      <td>0.262538</td>\n",
       "      <td>0.639602</td>\n",
       "      <td>0.144380</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.006489</td>\n",
       "      <td>0.398806</td>\n",
       "      <td>0.259879</td>\n",
       "      <td>0.787234</td>\n",
       "      <td>0.210114</td>\n",
       "      <td>4.502224e-01</td>\n",
       "      <td>-0.298675</td>\n",
       "      <td>0.202490</td>\n",
       "      <td>0.726816</td>\n",
       "      <td>0.271216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>594</th>\n",
       "      <td>0.198460</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.082305</td>\n",
       "      <td>0.145599</td>\n",
       "      <td>2.379293e-01</td>\n",
       "      <td>0.311258</td>\n",
       "      <td>-0.450281</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.011086</td>\n",
       "      <td>...</td>\n",
       "      <td>0.259828</td>\n",
       "      <td>0.098512</td>\n",
       "      <td>-0.233680</td>\n",
       "      <td>-0.270617</td>\n",
       "      <td>-0.153040</td>\n",
       "      <td>-1.051694e-01</td>\n",
       "      <td>-0.115238</td>\n",
       "      <td>-0.180774</td>\n",
       "      <td>-0.650000</td>\n",
       "      <td>-0.043506</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>595</th>\n",
       "      <td>0.509525</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.110432</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-8.164966e-01</td>\n",
       "      <td>0.471405</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.570406</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.544249e-01</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.745356</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.894427</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>596</th>\n",
       "      <td>0.563226</td>\n",
       "      <td>0.494077</td>\n",
       "      <td>0.607764</td>\n",
       "      <td>-0.065938</td>\n",
       "      <td>0.406382</td>\n",
       "      <td>3.363921e-01</td>\n",
       "      <td>0.539608</td>\n",
       "      <td>0.680877</td>\n",
       "      <td>0.367607</td>\n",
       "      <td>-0.200189</td>\n",
       "      <td>...</td>\n",
       "      <td>0.187672</td>\n",
       "      <td>0.056980</td>\n",
       "      <td>0.375950</td>\n",
       "      <td>0.319438</td>\n",
       "      <td>0.325484</td>\n",
       "      <td>3.417831e-01</td>\n",
       "      <td>0.184548</td>\n",
       "      <td>0.226736</td>\n",
       "      <td>0.141421</td>\n",
       "      <td>0.477917</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>597</th>\n",
       "      <td>0.427029</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.352130</td>\n",
       "      <td>0.202100</td>\n",
       "      <td>0.519907</td>\n",
       "      <td>-8.959725e-02</td>\n",
       "      <td>0.088391</td>\n",
       "      <td>0.176200</td>\n",
       "      <td>0.572078</td>\n",
       "      <td>-0.592220</td>\n",
       "      <td>...</td>\n",
       "      <td>0.475923</td>\n",
       "      <td>0.254153</td>\n",
       "      <td>0.333188</td>\n",
       "      <td>-0.123988</td>\n",
       "      <td>0.314511</td>\n",
       "      <td>3.796592e-01</td>\n",
       "      <td>0.154189</td>\n",
       "      <td>0.182582</td>\n",
       "      <td>0.247207</td>\n",
       "      <td>0.342623</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>598</th>\n",
       "      <td>1.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.277350</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.042796</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.225845</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.970725</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.295540</td>\n",
       "      <td>-2.054782e-01</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.320427</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.024915</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>599</th>\n",
       "      <td>0.219768</td>\n",
       "      <td>-0.016021</td>\n",
       "      <td>0.197731</td>\n",
       "      <td>0.080606</td>\n",
       "      <td>0.398080</td>\n",
       "      <td>6.142150e-02</td>\n",
       "      <td>0.251225</td>\n",
       "      <td>0.291301</td>\n",
       "      <td>0.394710</td>\n",
       "      <td>-0.413272</td>\n",
       "      <td>...</td>\n",
       "      <td>0.190302</td>\n",
       "      <td>0.286660</td>\n",
       "      <td>0.268020</td>\n",
       "      <td>0.031686</td>\n",
       "      <td>0.255495</td>\n",
       "      <td>3.681679e-01</td>\n",
       "      <td>-0.029093</td>\n",
       "      <td>0.346733</td>\n",
       "      <td>0.329146</td>\n",
       "      <td>0.510982</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>600</th>\n",
       "      <td>0.253649</td>\n",
       "      <td>0.188982</td>\n",
       "      <td>0.104257</td>\n",
       "      <td>0.128722</td>\n",
       "      <td>0.178820</td>\n",
       "      <td>1.527447e-01</td>\n",
       "      <td>0.345327</td>\n",
       "      <td>0.016668</td>\n",
       "      <td>0.506024</td>\n",
       "      <td>-0.106625</td>\n",
       "      <td>...</td>\n",
       "      <td>0.446703</td>\n",
       "      <td>0.246610</td>\n",
       "      <td>0.137651</td>\n",
       "      <td>0.262475</td>\n",
       "      <td>0.143555</td>\n",
       "      <td>2.836092e-01</td>\n",
       "      <td>-0.226531</td>\n",
       "      <td>0.107811</td>\n",
       "      <td>0.714920</td>\n",
       "      <td>0.325230</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>601</th>\n",
       "      <td>0.091574</td>\n",
       "      <td>-0.387347</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.222113</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>-2.927700e-01</td>\n",
       "      <td>-0.280496</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.577350</td>\n",
       "      <td>-0.397276</td>\n",
       "      <td>...</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.182719</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.412162</td>\n",
       "      <td>2.904896e-01</td>\n",
       "      <td>0.698241</td>\n",
       "      <td>0.473967</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.007025</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>602</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.396641</td>\n",
       "      <td>0.153303</td>\n",
       "      <td>-2.749519e-02</td>\n",
       "      <td>0.110432</td>\n",
       "      <td>0.190902</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.944911</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.089846</td>\n",
       "      <td>0.231290</td>\n",
       "      <td>0.113515</td>\n",
       "      <td>1.406134e-01</td>\n",
       "      <td>0.217210</td>\n",
       "      <td>0.297646</td>\n",
       "      <td>0.188512</td>\n",
       "      <td>0.049263</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>603</th>\n",
       "      <td>-0.061503</td>\n",
       "      <td>-1.000000</td>\n",
       "      <td>0.433200</td>\n",
       "      <td>0.090090</td>\n",
       "      <td>0.234743</td>\n",
       "      <td>-1.121408e-01</td>\n",
       "      <td>0.343649</td>\n",
       "      <td>0.249252</td>\n",
       "      <td>0.376715</td>\n",
       "      <td>-0.424631</td>\n",
       "      <td>...</td>\n",
       "      <td>0.182719</td>\n",
       "      <td>-0.089846</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.212682</td>\n",
       "      <td>-0.105975</td>\n",
       "      <td>3.184733e-01</td>\n",
       "      <td>0.192787</td>\n",
       "      <td>0.086423</td>\n",
       "      <td>0.343303</td>\n",
       "      <td>0.270908</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>604</th>\n",
       "      <td>-0.407556</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.080296</td>\n",
       "      <td>0.067791</td>\n",
       "      <td>-9.029693e-02</td>\n",
       "      <td>0.560968</td>\n",
       "      <td>0.534375</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-1.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.231290</td>\n",
       "      <td>0.212682</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.365959</td>\n",
       "      <td>6.829493e-01</td>\n",
       "      <td>0.035806</td>\n",
       "      <td>0.053986</td>\n",
       "      <td>0.641624</td>\n",
       "      <td>0.310611</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>605</th>\n",
       "      <td>-0.164871</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.400124</td>\n",
       "      <td>-0.364156</td>\n",
       "      <td>1.007346e-01</td>\n",
       "      <td>0.416186</td>\n",
       "      <td>-0.217405</td>\n",
       "      <td>0.158777</td>\n",
       "      <td>0.268684</td>\n",
       "      <td>...</td>\n",
       "      <td>0.412162</td>\n",
       "      <td>0.113515</td>\n",
       "      <td>-0.105975</td>\n",
       "      <td>-0.365959</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.670620e-01</td>\n",
       "      <td>-0.299641</td>\n",
       "      <td>-0.075673</td>\n",
       "      <td>-0.550000</td>\n",
       "      <td>0.462274</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>606</th>\n",
       "      <td>0.066378</td>\n",
       "      <td>0.583333</td>\n",
       "      <td>-0.791334</td>\n",
       "      <td>0.144603</td>\n",
       "      <td>0.244321</td>\n",
       "      <td>-4.919190e-02</td>\n",
       "      <td>0.137771</td>\n",
       "      <td>0.253582</td>\n",
       "      <td>0.572700</td>\n",
       "      <td>-0.382955</td>\n",
       "      <td>...</td>\n",
       "      <td>0.290490</td>\n",
       "      <td>0.140613</td>\n",
       "      <td>0.318473</td>\n",
       "      <td>0.682949</td>\n",
       "      <td>0.167062</td>\n",
       "      <td>1.000000e+00</td>\n",
       "      <td>0.114191</td>\n",
       "      <td>0.240842</td>\n",
       "      <td>0.533002</td>\n",
       "      <td>0.389185</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>607</th>\n",
       "      <td>0.174557</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.333333</td>\n",
       "      <td>0.116518</td>\n",
       "      <td>0.231080</td>\n",
       "      <td>2.556391e-01</td>\n",
       "      <td>0.402792</td>\n",
       "      <td>0.251280</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.241121</td>\n",
       "      <td>...</td>\n",
       "      <td>0.698241</td>\n",
       "      <td>0.217210</td>\n",
       "      <td>0.192787</td>\n",
       "      <td>0.035806</td>\n",
       "      <td>-0.299641</td>\n",
       "      <td>1.141912e-01</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.200814</td>\n",
       "      <td>0.190117</td>\n",
       "      <td>0.106605</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>608</th>\n",
       "      <td>0.268070</td>\n",
       "      <td>-0.125000</td>\n",
       "      <td>-0.395092</td>\n",
       "      <td>-0.170501</td>\n",
       "      <td>-0.020546</td>\n",
       "      <td>1.254283e-01</td>\n",
       "      <td>0.008081</td>\n",
       "      <td>0.434423</td>\n",
       "      <td>0.336625</td>\n",
       "      <td>-0.571043</td>\n",
       "      <td>...</td>\n",
       "      <td>0.473967</td>\n",
       "      <td>0.297646</td>\n",
       "      <td>0.086423</td>\n",
       "      <td>0.053986</td>\n",
       "      <td>-0.075673</td>\n",
       "      <td>2.408422e-01</td>\n",
       "      <td>0.200814</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.488929</td>\n",
       "      <td>0.147606</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>609</th>\n",
       "      <td>-0.175412</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.277350</td>\n",
       "      <td>0.384111</td>\n",
       "      <td>1.936492e-01</td>\n",
       "      <td>0.420288</td>\n",
       "      <td>0.141860</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.188512</td>\n",
       "      <td>0.343303</td>\n",
       "      <td>0.641624</td>\n",
       "      <td>-0.550000</td>\n",
       "      <td>5.330018e-01</td>\n",
       "      <td>0.190117</td>\n",
       "      <td>0.488929</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.521773</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>610</th>\n",
       "      <td>-0.032086</td>\n",
       "      <td>0.623288</td>\n",
       "      <td>0.569562</td>\n",
       "      <td>-0.043786</td>\n",
       "      <td>0.040582</td>\n",
       "      <td>1.155802e-01</td>\n",
       "      <td>0.341233</td>\n",
       "      <td>0.167931</td>\n",
       "      <td>0.615638</td>\n",
       "      <td>-0.205081</td>\n",
       "      <td>...</td>\n",
       "      <td>0.007025</td>\n",
       "      <td>0.049263</td>\n",
       "      <td>0.270908</td>\n",
       "      <td>0.310611</td>\n",
       "      <td>0.462274</td>\n",
       "      <td>3.891852e-01</td>\n",
       "      <td>0.106605</td>\n",
       "      <td>0.147606</td>\n",
       "      <td>-0.521773</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>610 rows × 610 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "userId       1         2         3         4         5             6    \\\n",
       "userId                                                                   \n",
       "1       1.000000       NaN  0.079819  0.207983  0.268749 -2.916358e-01   \n",
       "2            NaN  1.000000       NaN       NaN       NaN           NaN   \n",
       "3       0.079819       NaN  1.000000       NaN       NaN           NaN   \n",
       "4       0.207983       NaN       NaN  1.000000 -0.336525  1.484982e-01   \n",
       "5       0.268749       NaN       NaN -0.336525  1.000000  4.316590e-02   \n",
       "6      -0.291636       NaN       NaN  0.148498  0.043166  1.000000e+00   \n",
       "7      -0.118773 -0.991241       NaN  0.542861  0.158114 -1.265950e-01   \n",
       "8       0.469668       NaN       NaN  0.117851  0.028347 -2.000621e-01   \n",
       "9       0.918559       NaN       NaN       NaN       NaN           NaN   \n",
       "10     -0.037987  0.037796       NaN  0.485794 -0.777714  9.574271e-01   \n",
       "11     -0.087643       NaN       NaN  0.564737  0.268293  4.832447e-01   \n",
       "12           NaN       NaN       NaN -0.344031  1.000000  0.000000e+00   \n",
       "13      0.878310       NaN       NaN -0.558242       NaN           NaN   \n",
       "14      0.229081       NaN       NaN -0.139347 -0.153323  2.766621e-01   \n",
       "15      0.232636 -0.330174 -0.944911  0.481605 -0.252352  1.163945e-02   \n",
       "16      0.191851 -0.176471       NaN -0.137553 -0.684653 -1.837726e-02   \n",
       "17      0.037901  0.000000       NaN -0.218928  0.310835  2.400077e-02   \n",
       "18      0.205371 -0.264646 -0.354548 -0.007641  0.162995  9.380339e-03   \n",
       "19      0.325180       NaN -0.442498  0.072000  0.271827  2.591888e-01   \n",
       "20      0.419641       NaN       NaN  0.620758  0.040032  2.133011e-01   \n",
       "21      0.107119 -0.020535 -0.991241 -0.059131 -0.339422  3.057183e-01   \n",
       "22     -0.463039 -0.619292       NaN  0.259412       NaN  8.964215e-01   \n",
       "23     -0.364372       NaN       NaN -0.229480  0.000000 -4.050463e-01   \n",
       "24      0.249046 -0.641689       NaN  0.151800  0.193649  7.775791e-02   \n",
       "25     -0.166667  0.108465       NaN       NaN       NaN           NaN   \n",
       "26      0.141421       NaN       NaN       NaN  0.586739 -1.036641e-17   \n",
       "27      0.189437       NaN       NaN  0.101143  0.000000  4.821188e-01   \n",
       "28     -0.014257 -0.166667  0.204140  0.125013  0.201241 -1.383784e-01   \n",
       "29     -0.070495 -0.310087       NaN  0.455842 -0.681385  7.145774e-01   \n",
       "30     -0.142857       NaN       NaN       NaN  0.500000  1.000000e+00   \n",
       "...          ...       ...       ...       ...       ...           ...   \n",
       "581     0.000000 -0.790569       NaN  0.688499       NaN -5.000000e-01   \n",
       "582     0.250000  0.044194       NaN -0.613941       NaN           NaN   \n",
       "583    -0.037878       NaN       NaN -0.793045 -0.612372 -1.477635e-01   \n",
       "584    -0.076086       NaN       NaN -0.127294  0.257629  4.749685e-01   \n",
       "585     0.055703  0.000000       NaN  0.058537       NaN  5.000000e-01   \n",
       "586     0.163573 -0.197203       NaN -0.170842 -0.423659  2.995523e-01   \n",
       "587    -0.302195       NaN -0.500000 -0.259693  0.704361  3.380148e-02   \n",
       "588    -0.028161 -1.000000       NaN  0.357217  0.314098  7.215966e-02   \n",
       "589    -0.388075       NaN       NaN -0.052342  0.484248  4.108614e-01   \n",
       "590     0.311182  0.000000 -0.471728  0.388334  0.402967  1.119786e-01   \n",
       "591     0.280875       NaN       NaN -0.024876       NaN  9.449112e-01   \n",
       "592    -0.096225 -1.000000       NaN  0.054554 -0.104103  3.039877e-01   \n",
       "593     0.492483 -0.576557       NaN  0.239270  0.327896 -1.125112e-01   \n",
       "594     0.198460       NaN       NaN -0.082305  0.145599  2.379293e-01   \n",
       "595     0.509525       NaN       NaN  0.110432       NaN -8.164966e-01   \n",
       "596     0.563226  0.494077  0.607764 -0.065938  0.406382  3.363921e-01   \n",
       "597     0.427029       NaN -0.352130  0.202100  0.519907 -8.959725e-02   \n",
       "598     1.000000       NaN       NaN  0.277350       NaN           NaN   \n",
       "599     0.219768 -0.016021  0.197731  0.080606  0.398080  6.142150e-02   \n",
       "600     0.253649  0.188982  0.104257  0.128722  0.178820  1.527447e-01   \n",
       "601     0.091574 -0.387347       NaN -0.222113  0.000000 -2.927700e-01   \n",
       "602     0.000000       NaN       NaN  0.396641  0.153303 -2.749519e-02   \n",
       "603    -0.061503 -1.000000  0.433200  0.090090  0.234743 -1.121408e-01   \n",
       "604    -0.407556       NaN       NaN -0.080296  0.067791 -9.029693e-02   \n",
       "605    -0.164871       NaN       NaN  0.400124 -0.364156  1.007346e-01   \n",
       "606     0.066378  0.583333 -0.791334  0.144603  0.244321 -4.919190e-02   \n",
       "607     0.174557       NaN -0.333333  0.116518  0.231080  2.556391e-01   \n",
       "608     0.268070 -0.125000 -0.395092 -0.170501 -0.020546  1.254283e-01   \n",
       "609    -0.175412       NaN       NaN -0.277350  0.384111  1.936492e-01   \n",
       "610    -0.032086  0.623288  0.569562 -0.043786  0.040582  1.155802e-01   \n",
       "\n",
       "userId       7         8         9         10     ...          601       602  \\\n",
       "userId                                            ...                          \n",
       "1      -0.118773  0.469668  0.918559 -0.037987    ...     0.091574  0.000000   \n",
       "2      -0.991241       NaN       NaN  0.037796    ...    -0.387347       NaN   \n",
       "3            NaN       NaN       NaN       NaN    ...          NaN       NaN   \n",
       "4       0.542861  0.117851       NaN  0.485794    ...    -0.222113  0.396641   \n",
       "5       0.158114  0.028347       NaN -0.777714    ...     0.000000  0.153303   \n",
       "6      -0.126595 -0.200062       NaN  0.957427    ...    -0.292770 -0.027495   \n",
       "7       1.000000  0.220416  0.925000 -0.156764    ...    -0.280496  0.110432   \n",
       "8       0.220416  1.000000       NaN -1.000000    ...     1.000000  0.190902   \n",
       "9       0.925000       NaN  1.000000       NaN    ...     0.577350       NaN   \n",
       "10     -0.156764 -1.000000       NaN  1.000000    ...    -0.397276 -0.944911   \n",
       "11     -0.027349  0.253576       NaN       NaN    ...    -0.301511  0.274963   \n",
       "12      0.000000 -1.000000       NaN  0.562500    ...          NaN  1.000000   \n",
       "13     -0.500000  1.000000       NaN -0.381246    ...     0.375000  1.000000   \n",
       "14      0.806872  0.123460       NaN  0.500000    ...    -1.000000  0.017314   \n",
       "15     -0.155384 -0.139122 -0.482805 -0.030515    ...     0.098446  0.665169   \n",
       "16     -0.096233  0.665133       NaN  0.583639    ...    -0.157174  0.086212   \n",
       "17      0.287803  0.000000       NaN -0.005896    ...     0.192548  0.323875   \n",
       "18      0.206082  0.029953  0.252714 -0.082679    ...     0.264801  0.423578   \n",
       "19      0.194649  0.139882  0.976296 -0.561617    ...     0.561962  0.246154   \n",
       "20      0.451035  0.747018  0.561249  0.122967    ...    -0.338062  0.393445   \n",
       "21      0.024363  0.084020 -0.386592  0.269043    ...    -0.150859  0.147429   \n",
       "22      0.053010 -0.500000       NaN -0.035275    ...    -0.113398  0.500000   \n",
       "23      0.175781  0.324443       NaN -0.218218    ...     0.261839 -0.090909   \n",
       "24     -0.057351  0.166667  1.000000 -0.049613    ...     0.448297  0.128046   \n",
       "25           NaN  1.000000       NaN       NaN    ...     0.284901  1.000000   \n",
       "26     -0.099504  0.094655       NaN -1.000000    ...          NaN  0.566266   \n",
       "27     -0.117892 -0.108465  1.000000  0.654654    ...     0.198030 -0.255678   \n",
       "28      0.000068  0.056400 -0.057640 -0.051243    ...     0.122248  0.104556   \n",
       "29     -0.428521 -0.298807       NaN  0.568982    ...     0.132353  0.030802   \n",
       "30      0.105577       NaN       NaN       NaN    ...          NaN       NaN   \n",
       "...          ...       ...       ...       ...    ...          ...       ...   \n",
       "581     0.069077  1.000000       NaN  0.324953    ...     0.223836  1.000000   \n",
       "582    -0.325818       NaN       NaN  0.135653    ...     0.093532       NaN   \n",
       "583    -0.300123 -0.663403       NaN -0.380072    ...     0.583333 -0.080845   \n",
       "584     0.132260  0.078422       NaN  0.514259    ...          NaN  0.154225   \n",
       "585    -0.174078       NaN  1.000000 -0.894675    ...    -0.500000  0.250000   \n",
       "586     0.036261 -0.198539  0.142857  0.101297    ...     0.112945  0.224965   \n",
       "587    -0.253046  0.094555 -0.277350 -0.126745    ...     0.194257  0.302627   \n",
       "588     0.474101  0.084579       NaN -1.000000    ...     0.870388  0.476251   \n",
       "589    -0.133631  0.116775       NaN       NaN    ...          NaN  0.317258   \n",
       "590     0.449615  0.323569  0.486943  0.110148    ...     0.331841  0.498185   \n",
       "591     0.038029       NaN       NaN  0.399381    ...    -0.468521  0.188982   \n",
       "592     0.140563  0.114093       NaN  0.257130    ...          NaN  0.225521   \n",
       "593     0.230481  0.262538  0.639602  0.144380    ...    -0.006489  0.398806   \n",
       "594     0.311258 -0.450281       NaN  0.011086    ...     0.259828  0.098512   \n",
       "595     0.471405       NaN       NaN       NaN    ...          NaN  0.000000   \n",
       "596     0.539608  0.680877  0.367607 -0.200189    ...     0.187672  0.056980   \n",
       "597     0.088391  0.176200  0.572078 -0.592220    ...     0.475923  0.254153   \n",
       "598     0.042796       NaN       NaN -1.000000    ...    -0.225845       NaN   \n",
       "599     0.251225  0.291301  0.394710 -0.413272    ...     0.190302  0.286660   \n",
       "600     0.345327  0.016668  0.506024 -0.106625    ...     0.446703  0.246610   \n",
       "601    -0.280496  1.000000  0.577350 -0.397276    ...     1.000000       NaN   \n",
       "602     0.110432  0.190902       NaN -0.944911    ...          NaN  1.000000   \n",
       "603     0.343649  0.249252  0.376715 -0.424631    ...     0.182719 -0.089846   \n",
       "604     0.560968  0.534375       NaN -1.000000    ...          NaN  0.231290   \n",
       "605     0.416186 -0.217405  0.158777  0.268684    ...     0.412162  0.113515   \n",
       "606     0.137771  0.253582  0.572700 -0.382955    ...     0.290490  0.140613   \n",
       "607     0.402792  0.251280       NaN -0.241121    ...     0.698241  0.217210   \n",
       "608     0.008081  0.434423  0.336625 -0.571043    ...     0.473967  0.297646   \n",
       "609     0.420288  0.141860       NaN       NaN    ...     1.000000  0.188512   \n",
       "610     0.341233  0.167931  0.615638 -0.205081    ...     0.007025  0.049263   \n",
       "\n",
       "userId       603       604       605           606       607       608  \\\n",
       "userId                                                                   \n",
       "1      -0.061503 -0.407556 -0.164871  6.637849e-02  0.174557  0.268070   \n",
       "2      -1.000000       NaN       NaN  5.833333e-01       NaN -0.125000   \n",
       "3       0.433200       NaN       NaN -7.913343e-01 -0.333333 -0.395092   \n",
       "4       0.090090 -0.080296  0.400124  1.446033e-01  0.116518 -0.170501   \n",
       "5       0.234743  0.067791 -0.364156  2.443212e-01  0.231080 -0.020546   \n",
       "6      -0.112141 -0.090297  0.100735 -4.919190e-02  0.255639  0.125428   \n",
       "7       0.343649  0.560968  0.416186  1.377715e-01  0.402792  0.008081   \n",
       "8       0.249252  0.534375 -0.217405  2.535821e-01  0.251280  0.434423   \n",
       "9       0.376715       NaN  0.158777  5.726999e-01       NaN  0.336625   \n",
       "10     -0.424631 -1.000000  0.268684 -3.829551e-01 -0.241121 -0.571043   \n",
       "11     -0.176996 -0.015131 -0.019104  6.213867e-01  0.434014  0.335976   \n",
       "12     -0.248679 -0.507093  0.500000  8.956222e-02 -0.365148 -0.322817   \n",
       "13      0.674020       NaN       NaN  7.755102e-02  0.188982  0.493318   \n",
       "14      0.188061  0.507168 -0.151620  3.468145e-01  0.223669  0.238901   \n",
       "15     -0.047094  0.534634  0.124442  8.667785e-02 -0.084814  0.344304   \n",
       "16      0.157807 -0.754337  0.012649 -4.867394e-02  0.055125 -0.302915   \n",
       "17      0.174955  0.528594 -0.147821  1.226658e-01 -0.189118  0.300821   \n",
       "18      0.389637  0.203806  0.103834  5.216392e-01  0.169145  0.375750   \n",
       "19      0.160288  0.093863  0.256556  2.542703e-01  0.003567  0.229268   \n",
       "20      0.244265 -0.610802  0.085819  4.328764e-01  0.319964  0.030331   \n",
       "21     -0.485182  0.265872 -0.008274 -1.638329e-01 -0.237823  0.028065   \n",
       "22      0.424252       NaN -0.321719  2.230021e-02  0.141421 -0.106111   \n",
       "23      0.023665 -0.190941  0.500000  2.367592e-01  0.024012 -0.029124   \n",
       "24      0.207174 -0.099340 -0.229170  1.857959e-01  0.195180  0.176818   \n",
       "25           NaN       NaN       NaN  7.287987e-01       NaN  0.693375   \n",
       "26      0.408248  0.448943 -0.625000  9.128709e-02  0.224934  0.493881   \n",
       "27     -0.318164  0.114708  0.194420 -4.161383e-02  0.058042  0.018718   \n",
       "28      0.040900  0.031379  0.064034  7.209501e-02 -0.123055  0.202252   \n",
       "29      0.560054  0.426401  0.368782 -5.475182e-17  0.372222  0.032340   \n",
       "30     -0.303770       NaN  0.403473  4.536438e-01 -0.312255  0.402953   \n",
       "...          ...       ...       ...           ...       ...       ...   \n",
       "581    -0.311400       NaN -0.297936 -4.707512e-03  0.069843 -0.247073   \n",
       "582     0.400000       NaN -0.027639 -1.935282e-02  0.577350  0.438529   \n",
       "583     0.249950 -0.391965  0.310530  2.557321e-01 -1.000000 -0.048508   \n",
       "584    -0.105695  0.078851  0.116250 -1.458650e-01  0.709014 -0.104141   \n",
       "585    -0.103975  1.000000 -1.000000  1.836735e-01  0.577350  0.001186   \n",
       "586    -0.343401 -0.286770  0.376335 -6.999917e-02 -0.343266  0.102785   \n",
       "587    -0.079892  0.724882  0.066567  1.583314e-01 -0.125983  0.212576   \n",
       "588    -0.019080  0.102512 -0.498922  5.858504e-01  0.642569  0.531998   \n",
       "589     0.164717  0.520855 -0.868243  3.984854e-01 -0.290129  0.370555   \n",
       "590     0.337366  0.317766  0.300918  5.564658e-01  0.152790  0.231666   \n",
       "591    -0.044991       NaN  0.687500 -8.918451e-02  0.046176  0.133974   \n",
       "592    -0.076214 -0.004300  0.043129  1.934440e-01  0.413537  0.154820   \n",
       "593     0.259879  0.787234  0.210114  4.502224e-01 -0.298675  0.202490   \n",
       "594    -0.233680 -0.270617 -0.153040 -1.051694e-01 -0.115238 -0.180774   \n",
       "595     0.570406       NaN       NaN  1.544249e-01       NaN  0.745356   \n",
       "596     0.375950  0.319438  0.325484  3.417831e-01  0.184548  0.226736   \n",
       "597     0.333188 -0.123988  0.314511  3.796592e-01  0.154189  0.182582   \n",
       "598    -0.970725       NaN -0.295540 -2.054782e-01       NaN -0.320427   \n",
       "599     0.268020  0.031686  0.255495  3.681679e-01 -0.029093  0.346733   \n",
       "600     0.137651  0.262475  0.143555  2.836092e-01 -0.226531  0.107811   \n",
       "601     0.182719       NaN  0.412162  2.904896e-01  0.698241  0.473967   \n",
       "602    -0.089846  0.231290  0.113515  1.406134e-01  0.217210  0.297646   \n",
       "603     1.000000  0.212682 -0.105975  3.184733e-01  0.192787  0.086423   \n",
       "604     0.212682  1.000000 -0.365959  6.829493e-01  0.035806  0.053986   \n",
       "605    -0.105975 -0.365959  1.000000  1.670620e-01 -0.299641 -0.075673   \n",
       "606     0.318473  0.682949  0.167062  1.000000e+00  0.114191  0.240842   \n",
       "607     0.192787  0.035806 -0.299641  1.141912e-01  1.000000  0.200814   \n",
       "608     0.086423  0.053986 -0.075673  2.408422e-01  0.200814  1.000000   \n",
       "609     0.343303  0.641624 -0.550000  5.330018e-01  0.190117  0.488929   \n",
       "610     0.270908  0.310611  0.462274  3.891852e-01  0.106605  0.147606   \n",
       "\n",
       "userId       609       610  \n",
       "userId                      \n",
       "1      -0.175412 -0.032086  \n",
       "2            NaN  0.623288  \n",
       "3            NaN  0.569562  \n",
       "4      -0.277350 -0.043786  \n",
       "5       0.384111  0.040582  \n",
       "6       0.193649  0.115580  \n",
       "7       0.420288  0.341233  \n",
       "8       0.141860  0.167931  \n",
       "9            NaN  0.615638  \n",
       "10           NaN -0.205081  \n",
       "11      0.151744  0.137054  \n",
       "12           NaN -0.672977  \n",
       "13           NaN  0.796969  \n",
       "14     -0.077615  0.140482  \n",
       "15      0.458333 -0.099907  \n",
       "16           NaN -0.134150  \n",
       "17      0.638915 -0.034653  \n",
       "18      0.400000  0.327397  \n",
       "19     -0.068519  0.399213  \n",
       "20           NaN  0.413368  \n",
       "21      0.623250 -0.063044  \n",
       "22           NaN  0.208517  \n",
       "23      1.000000 -0.074424  \n",
       "24           NaN  0.121548  \n",
       "25           NaN  0.371303  \n",
       "26      0.336011  0.701646  \n",
       "27      0.707107 -0.199442  \n",
       "28      0.337080  0.176014  \n",
       "29      0.174078  0.048994  \n",
       "30      0.500000 -0.251636  \n",
       "...          ...       ...  \n",
       "581          NaN -0.107907  \n",
       "582          NaN  0.415336  \n",
       "583          NaN -0.099776  \n",
       "584    -0.032978  0.521057  \n",
       "585          NaN  0.059085  \n",
       "586     0.342594  0.038017  \n",
       "587     0.166667  0.396926  \n",
       "588     0.373737  0.198529  \n",
       "589     0.885438 -0.154303  \n",
       "590     0.280692  0.522279  \n",
       "591          NaN  0.059337  \n",
       "592     0.037860  0.257958  \n",
       "593     0.726816  0.271216  \n",
       "594    -0.650000 -0.043506  \n",
       "595          NaN  0.894427  \n",
       "596     0.141421  0.477917  \n",
       "597     0.247207  0.342623  \n",
       "598          NaN -0.024915  \n",
       "599     0.329146  0.510982  \n",
       "600     0.714920  0.325230  \n",
       "601     1.000000  0.007025  \n",
       "602     0.188512  0.049263  \n",
       "603     0.343303  0.270908  \n",
       "604     0.641624  0.310611  \n",
       "605    -0.550000  0.462274  \n",
       "606     0.533002  0.389185  \n",
       "607     0.190117  0.106605  \n",
       "608     0.488929  0.147606  \n",
       "609     1.000000 -0.521773  \n",
       "610    -0.521773  1.000000  \n",
       "\n",
       "[610 rows x 610 columns]"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "user_similar"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "预测出用户<1>对电影<1>的评分：3.87\n"
     ]
    }
   ],
   "source": [
    "# 1. 找出uid用户的相似用户\n",
    "similar_users = user_similar[1].drop([1]).dropna()\n",
    "# 相似用户筛选规则：正相关的用户\n",
    "similar_users = similar_users.where(similar_users>0).dropna()\n",
    "# 2. 从用户1的近邻相似用户中筛选出对物品1有评分记录的近邻用户\n",
    "ids = set(ratings_matrix[1].dropna().index)&set(similar_users.index)\n",
    "finally_similar_users = similar_users.loc[list(ids)]\n",
    "# 3. 结合uid用户与其近邻用户的相似度预测uid用户对iid物品的评分\n",
    "numerator = 0    # 评分预测公式的分子部分的值\n",
    "denominator = 0    # 评分预测公式的分母部分的值\n",
    "for sim_uid, similarity in finally_similar_users.iteritems():\n",
    "    # 近邻用户的评分数据\n",
    "    sim_user_rated_movies = ratings_matrix.loc[sim_uid].dropna()\n",
    "    # 近邻用户对iid物品的评分\n",
    "    sim_user_rating_for_item = sim_user_rated_movies[1]\n",
    "    # 计算分子的值\n",
    "    numerator += similarity * sim_user_rating_for_item\n",
    "    # 计算分母的值\n",
    "    denominator += similarity\n",
    "# 4 计算预测的评分值\n",
    "predict_rating = numerator/denominator\n",
    "print(\"预测出用户<%d>对电影<%d>的评分：%0.2f\" % (1, 1, predict_rating))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "def predict(uid, iid, ratings_matrix, user_similar):\n",
    "    '''\n",
    "    预测给定用户对给定物品的评分值\n",
    "    :param uid: 用户ID\n",
    "    :param iid: 物品ID\n",
    "    :param ratings_matrix: 用户-物品评分矩阵\n",
    "    :param user_similar: 用户两两相似度矩阵\n",
    "    :return: 预测的评分值\n",
    "    '''\n",
    "    print(\"开始预测用户<%d>对电影<%d>的评分...\"%(uid, iid))\n",
    "    # 1. 找出uid用户的相似用户\n",
    "    similar_users = user_similar[uid].drop([uid]).dropna()\n",
    "    # 相似用户筛选规则：正相关的用户\n",
    "    similar_users = similar_users.where(similar_users>0).dropna()\n",
    "    if similar_users.empty is True:\n",
    "        raise Exception(\"用户<%d>没有相似的用户\" % uid)\n",
    "\n",
    "    # 2. 从uid用户的近邻相似用户中筛选出对iid物品有评分记录的近邻用户\n",
    "    ids = set(ratings_matrix[iid].dropna().index)&set(similar_users.index)\n",
    "    finally_similar_users = similar_users.loc[list(ids)]\n",
    "\n",
    "    # 3. 结合uid用户与其近邻用户的相似度预测uid用户对iid物品的评分\n",
    "    numerator = 0    # 评分预测公式的分子部分的值\n",
    "    denominator = 0    # 评分预测公式的分母部分的值\n",
    "    for sim_uid, similarity in finally_similar_users.iteritems():\n",
    "        # 近邻用户的评分数据\n",
    "        sim_user_rated_movies = ratings_matrix.loc[sim_uid].dropna()\n",
    "        # 近邻用户对iid物品的评分\n",
    "        sim_user_rating_for_item = sim_user_rated_movies[iid]\n",
    "        # 计算分子的值\n",
    "        numerator += similarity * sim_user_rating_for_item\n",
    "        # 计算分母的值\n",
    "        denominator += similarity\n",
    "\n",
    "    # 计算预测的评分值并返回\n",
    "    predict_rating = numerator/denominator\n",
    "    print(\"预测出用户<%d>对电影<%d>的评分：%0.2f\" % (uid, iid, predict_rating))\n",
    "    return round(predict_rating, 2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "开始预测用户<1>对电影<2>的评分...\n",
      "预测出用户<1>对电影<2>的评分：3.38\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "3.38"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "predict(1, 2, ratings_matrix, user_similar)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
